package com.java.androidmarket.dao;

import com.java.androidmarket.entity.Cart;
import com.java.androidmarket.entity.Goods;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * description:
 * author:张腾
 * date:2021-04-30
 */

@Mapper
public interface CartDao {

    List<Goods> getCart(int userId);

    int ifExist(@Param("userId") int userId, @Param("goodsId") int goodsId);

    void addCart(@Param("userId") int userId, @Param("goodsId") int goodsId);

    void incrNum(@Param("userId") int userId, @Param("goodsId") int goodsId);

    void updateGoodsNum(@Param("userId") int userId, @Param("goodsId") int goodsId,@Param("goodsNum") int goodsNum);

    int selectNum(@Param("userId") int userId, @Param("goodsId") int goodsId);

    void deleteGoods(@Param("userId") int userId,@Param("goodsId") int goodsId);
}
